package com.iot.controller;

import com.iot.config.R;
import com.iot.controller.dto.TestDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "测试接口",description = "调试数据")
@Slf4j
public class TestController {

    @Autowired
    StringRedisTemplate stringRedisTemplate;

    @ApiOperation(value = "测试接口", notes = "测试函数api")
    @PostMapping("/test")
    public R test(@RequestBody TestDto testDto) {
        log.info("tag:{}",testDto);
        stringRedisTemplate.opsForValue().set("test", "test");
        return R.ok().put("msg", "test");
    }

}
